Interview Questions and Answer
Options:
a. name
b. value
c. name and value pair
d. none
Reveal Answer
Options:
a. client machine
b. server machine
c. browser
d. all
Reveal Answer
Options:
a. document(cookie)
b. document.cookie
c. document.cookie()
d. none
Reveal Answer
Options:
a. document(cookie) = "username=John Doe";
b. document.cookie = username=John Doe;
c. document.cookie = "username=John Doe";
d. document.cookie() = "username=John Doe";
Reveal Answer
Options:
a. document.cookie = "username=John Doe; expires=Thu, 18 Dec 2013 12:00:00 UTC";
b. document.cookie() = "username=John Doe; expires=Thu, 18 Dec 2013 12:00:00 UTC";
c. document.cookie = "username=John Doe”; expires=Thu, 18 Dec 2013 12:00:00 UTC;
d. All
Reveal Answer
Options:
a. document.cookie=delete;
b. document.cookie=expire;
c. cookie.expire;
d. cookie.delete;
Reveal Answer
Options:
a. A function to set a cookie value
b. A function to get a cookie value
c. A function to check a cookie value
d. All
Reveal Answer
Options:
a. function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; }
b. function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; }
c. function checkCookie() { var user = getCookie("username"); if (user != "") { alert("Welcome again " + user); } else { user = prompt("Please enter your name:", ""); if (user != "" && user != null) { setCookie("username", user, 365); } } }
d. All
Reveal Answer
Bestitcourse google plus

Thank you for visiting BestITCourses, How can I help you

Thank you for visiting BestITCourses, How can I help you